package com.wswy.wyjk.ui.widget

import android.content.Context
import android.support.v4.content.ContextCompat
import android.support.v7.widget.AppCompatTextView
import android.util.AttributeSet
import com.wswy.wyjk.AppContext
import com.wswy.wyjk.R

class RecordStatusTextView : AppCompatTextView {

    constructor(context: Context) : this(context, null)

    constructor(context: Context, attribute: AttributeSet?) : this(context, attribute, 0)

    constructor(context: Context, attribute: AttributeSet?, defStyle: Int) : super(context, attribute, defStyle) {


    }


    fun setNormal(){
        setTextColor(ContextCompat.getColor(context, R.color.textColorSecondary))

        setBackgroundResource(R.drawable.record_normal_bg)
    }

    fun setRight(){

        setTextColor(ContextCompat.getColor(context, R.color.colorPrimary))
        setBackgroundResource(R.drawable.record_right_bg)
    }

    fun setWrong(){
        setTextColor(ContextCompat.getColor(context, R.color.textColorWrong))
        setBackgroundResource(R.drawable.record_wrong_bg)
    }

}